package com.lj.demo.cmsservice.controller;

import com.lj.demo.cmsservice.entity.CrmBanner;
import com.lj.demo.cmsservice.service.CrmBannerService;
import com.lj.demo.commonutils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: liujiang
 * @Date: 2020/12/21/21:15
 * @Description:
 */
@Api(description = "网站首页banner列表")
@RestController
@RequestMapping("/cmsservice/frontBanner")
//@CrossOrigin
public class BannerfrontController {

    @Autowired
    private CrmBannerService crmBannerService;

    @ApiOperation(value = "获取首页幻灯片")
    @GetMapping("getAllBanner")
    public R Index(){
       List<CrmBanner> list = crmBannerService.selectBannerList();
       return R.ok().data("items",list);
    }


}
